import request from '@/utils/request'

// 设置床位护理员
export function setBedCaregivers(bedId, caregiverIds) {
  return request({
    url: '/system/binding/setBedCaregivers',
    method: 'post',
    params: { bedId },
    data: caregiverIds
  })
}

// 批量设置床位护理员
export function batchSetBedCaregivers(bedIds, caregiverIds) {
    return request({
      url: '/system/binding/batchSetBedCaregivers',
      method: 'post',
      params: { 
        bedIds: bedIds.join(',') // 将数组转换为逗号分隔的字符串
      },
      data: caregiverIds
    })
  }
// 移除床位的护理员
export function removeBedCaregiver(bedId, caregiverId) {
  return request({
    url: '/system/binding/removeBedCaregiver',
    method: 'delete',
    params: { bedId, caregiverId }
  })
}

// 根据床位ID查询护理员绑定信息
export function getByBedId(bedId) {
  return request({
    url: `/system/binding/bed/${bedId}`,
    method: 'get'
  })
}